{% extends 'blog/base.html' %}

{% block content %}
    <h1>Unpublished posts</h1>
    <br>
    {% for post in posts %}
        <div class="post">
            <p class="date">Created: {{ post.created_date|date:'d-m-Y' }}</p>
            <h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
            <p>{{ post.text|truncatewords:30|linebreaksbr}}</p>
            <hr>
        </div>
    {% endfor %}
{% endblock %}